﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using _MetalSlug.MyCharacters.Characters;
using _MetalSlug.Weapons.Units;
using _MetalSlug.Weapons.Factory;
using _MetalSlug.Mission;


namespace _MetalSlug.Soldiers.Units
{
    public class Helicoper : Enemy
    {
        public override void LoadContent()
        {
            DieTexture2Ds = GameUtil.LoadTextures("Boom/Explode",16);
            StandTexture2Ds = ShotTexture2Ds = RunTexture2Ds = GameUtil.LoadTextures("helicoper/helicoper",2);
        }

        public Helicoper(Vector2 topleft, Vector2 size)
        {
            Type = TYPE_SOLDIER.HELICOPER;
            InitialAttribute(topleft, size);
            Hp = 500;  
            DistanceChase = new Segment { Min = 350, Max = 800 };
            DistanceShoot = new Segment { Min = 0, Max = 350 };
            DistanceFlip = 60;
            CharDirection = Vector2.UnitY;
        }

        public Helicoper(int ID)
        {
            // TODO: Complete member initialization
            id = ID;
        }

        protected override void Shoot()
        {
            Vector2 startShotPoint = new Vector2(TopLeft.X+70,TopLeft.Y+20);
            Vector2 BulletDirection = new Vector2(0,1);
            int count = Bullets.RemoveAll(item => !item.Visible);

            if (Bullets.Count == 0)
            {
                Bullet bullet = BulletStore.GetInstance().Produce(Bullet.TYPE_BULLET.BOOMHELI_BULLET);
                bullet.Fire(startShotPoint, BulletDirection);
                Bullets.Add(bullet);

            }
        }

        public override Enemy Clone(int ID, Vector2 topleft)
        {
            Enemy enemy = new Helicoper(ID);
            enemy.Copy(this, topleft);
            return enemy;
        }

    }
}